package com.mogist.hqc.module.order.ui

import android.content.Intent
import android.view.View
import butterknife.OnClick
import butterknife.Optional
import com.mogist.hqc.R
import com.mogist.hqc.base.BaseMVPActivity
import com.mogist.hqc.module.main.ui.MainActivity
import com.mogist.hqc.module.order.contract.OrderPayResultContract
import com.mogist.hqc.module.order.presenter.OrderPayResultPresenter

/**
 * 作用：订单支付结果
 * 作者：赵小白 email:vvtale@gmail.com  
 * 修改人：
 * 修改时间：
 * 修改备注：
 */
class OrderPayResultActivity : BaseMVPActivity<OrderPayResultContract.Presenter>(), OrderPayResultContract.View
{
    override fun initArgs(intent: Intent?)
    {
    }

    override fun initView()
    {
        setContentView(R.layout.activity_order_pay_result)
        mPresenter = OrderPayResultPresenter(this)
    }

    override fun initData()
    {
    }

    @Optional
    @OnClick(R.id.mTvMain, R.id.mTvOrder, R.id.mTvRePay)
    fun onViewClicked(view: View)
    {
        if (!isFastClick)
        {
            when (view.id)
            {
                R.id.mTvMain  ->
                { // 回到首页
                    val intent = Intent(this@OrderPayResultActivity, MainActivity::class.java)
                    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
                    start(intent)
                    finish()
                }
                R.id.mTvOrder ->
                { // 查看订单
                    val intent = Intent(this@OrderPayResultActivity, OrderListActivity::class.java)
                    intent.putExtra("pos", 2)
                    start(intent)
                    finish()
                }
                R.id.mTvRePay ->
                { // 重新支付
                }
            }
        }
    }

}